package com.nengchuan.eic.nceconomy.fegin;

import com.nengchuan.eic.nceconomy.config.FeignConfiguration;
import com.nengchuan.eic.nceconomy.entity.vo.OssFileReseponseVO;
import com.nengchuan.eic.nceconomy.entity.vo.OssStsconfigResponseVO;
import com.nengchuan.eic.nceconomy.entity.vo.OssUploadAddFileResponseVO;
import com.nengchuan.eic.nceconomy.entity.vo.OssUploadAddFileVO;
import com.nengchuan.model.model.WrappedResult;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "eic-file-service" ,path = "/file",configuration = FeignConfiguration.class)
public interface ProcessFeignFileService  {

	/**
	 * 获取配置信息
	 * @param serviceName
	 * @param busiName
	 * @return
	 */
	@GetMapping("/v1/conf/getstsconfig")
	@ApiOperation(value = "获取oss信息", notes = "get")
	WrappedResult<OssStsconfigResponseVO> getstsconfig(@RequestParam("serviceName") String serviceName, @RequestParam("busiName") String busiName);

	/**
	 * 上传文件信息
	 * @param ossUploadAddFileVO
	 * @return
	 */
	@PostMapping("/v1/files")
	@ApiOperation(value = "获取oss信息", notes = "post")
	WrappedResult<OssUploadAddFileResponseVO> ossUploadAddFile(@RequestBody OssUploadAddFileVO ossUploadAddFileVO);

	@GetMapping({"/v1/files/{id}"})
	@ApiOperation(value = "获取文件详细")
	public WrappedResult<OssFileReseponseVO> findById(@ApiParam(value = "文件ID", readOnly = true) @PathVariable("id") Long id, @RequestParam(value = "style") String style) ;


	@GetMapping("/v1/files/batch")
	@ApiOperation(value = "批量获取文件详细")
	public WrappedResult<List<OssFileReseponseVO>> findByIds(@ApiParam(value = "文件ID数组", required = true) @RequestParam("ids") List<Long> ids, @ApiParam(value = "样式") @RequestParam(value = "style") String style) ;
}


